import { ExpandOf, FriendOf } from "../../../Decorator/Decorator";
import { Entity } from "./Entity";
import { Scene } from "./Scene";

/**
 * 使用 Expand 扩展方法
 * 
 * 必须作出以下申明，才能调用对象的扩展方法
 */
declare module "./Entity" {

    interface Entity {

        DomainZone(): number;
        DomainScene(): Scene;

    }

}

@ExpandOf(Entity)
export class SceneHelper {

    private static DomainZone(entity: Entity) {
        return (<Scene>entity.Domain)?.Zone ?? 0;
    }

    private static DomainScene(entity: Entity) {
        return <Scene>entity.Domain;
    }
}